#ifndef FORM_SEND_H
#define FORM_SEND_H

#include <QWidget>
#include <QTcpSocket>
#include <QMessageBox>
#include <QCamera>
#include <QCameraViewfinder>
#include <QCameraImageCapture>
#include <QPixmap>
#include <QIODevice>
#include <QFile>
#include <QBuffer>
#include "form_box_status.h"
#include "ui_form_box_status.h"

namespace Ui {
class Form_send;
}

class Form_send : public QWidget
{
    Q_OBJECT

public:
    explicit Form_send(QWidget *parent = 0);
    ~Form_send();

    void Sleep(int msec);

    void clearall();

    int judge_phone_num();

    void read_photo();

    int get_info(QString recv);

    void new_connection();

    void send_send_request();

    void read_send_request();


    void send_qrcode_request_auto();

    void auto_photo_send();

private slots:
    void on_btn2_clicked();

    void on_btn1_clicked();

    void on_btn3_clicked();

    void on_btn4_clicked();

    void on_btn5_clicked();

    void on_btn6_clicked();

    void on_btn9_clicked();

    void on_btn7_clicked();

    void on_btn8_clicked();

    void on_btn0_clicked();

    void on_q_clicked();

    void on_w_clicked();

    void on_e_clicked();

    void on_r_clicked();

    void on_t_clicked();

    void on_y_clicked();

    void on_u_clicked();

    void on_i_clicked();

    void on_o_clicked();

    void on_p_clicked();

    void on_a_clicked();

    void on_s_clicked();

    void on_d_clicked();

    void on_f_clicked();

    void on_g_clicked();

    void on_h_clicked();

    void on_j_clicked();

    void on_k_clicked();

    void on_l_clicked();

    void on_z_clicked();

    void on_x_clicked();

    void on_c_clicked();

    void on_v_clicked();

    void on_b_clicked();

    void on_n_clicked();

    void on_m_clicked();

    void on_btn_del_clicked();

    void on_enter_clicked();

    void on_btn_ret_clicked();

    void on_btn_rewrite_clicked();

    void connectedSlot();

    void readSlot();

    void box_to_send_Slot();

    void on_btn_scan_clicked();

    void on_btn_photo_clicked();

    void displayImage(int,QImage);

signals:
    void return_delivery();


private:
    Ui::Form_send *ui;
    Form_box_status fbs;

    QString PHONE_CLIENT;
    QString last;

    int count_sure;
    int auto_or_manual;

    QTcpSocket *socket;

    QCamera *camera;
    QCameraViewfinder *viewfinder;
    QCameraImageCapture *imageCapture;

    QByteArray info_photo;
    QBuffer buffer;
    quint32 pix_len;
};

#endif // FORM_SEND_H
